package com.newer.procurementsystem.controller;

import com.newer.procurementsystem.dto.EmpLikeBy;
import com.newer.procurementsystem.model.Employee;
import com.newer.procurementsystem.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class EmployeeController {
    @Autowired
    private EmployeeService employeeService;

    //出库（领用）基本信息页面加载显示录入人基本信息
    @RequestMapping(value = "/selectInfoById",produces = {"application/json;charset=utf-8"})
    public Employee selectInfoById(){
        Employee employee = employeeService.selectInfoById(1);
        if(employee!=null){
            return employee;
        }
        return null;
    }

    //弹出框模糊查询员工列表
    @RequestMapping("/selectEmpLike")
    public List<Employee> selectEmpLike(EmpLikeBy empLikeBy){
        List<Employee> employees = employeeService.selectEmpLike(empLikeBy);
        if(employees!=null){
            return employees;
        }
        return null;
    }
}
